package mode.observer.jdk;

/**
 * jdk提供的观察者测试
 *
 * @author xjx
 * @date 2023/7/27 14:59
 */
public class MainTest {
    public static void main(String[] args) {
        WeixinUser user1 = new WeixinUser("张三");
        WeixinUser user2 = new WeixinUser("李四");
        WeixinUser user3 = new WeixinUser("王五");
        Subject subject = new Subject("演唱会消息发布");
        subject.addObserver(user1);
        subject.addObserver(user2);
        subject.addObserver(user3);
        subject.notifyMessage("薛之谦演唱会要来到广州啦!");
    }
}
